//
//  UIButton+Extension.swift
//  ZHTQWeibo
//
//  Created by ZHTQ on 2018/9/14.
//  Copyright © 2018年 ZHTQ. All rights reserved.
//

import UIKit

extension UIButton{
    
    ///便利构造方法快速设置图片和背景图片
    convenience init(image: String, backgroundImage: String) {
        self.init()
        
        setImage(UIImage(named: image), for: UIControlState.normal)
        setImage(UIImage(named: image + "_highlighted"), for: UIControlState.highlighted)
        setBackgroundImage(UIImage(named: backgroundImage), for: UIControlState.normal)
        setBackgroundImage(UIImage(named: backgroundImage + "_highlighted"), for: UIControlState.highlighted)
        
        sizeToFit()
        
    }
}
